package behavioral.interpreter;


public class Main {

    public static void main(String[] args) {
        String str1 = "REPECT 3 UP RIGHT LEFT END";
        String str2 = "RIGHT";

        //Context 接收不同文法的字符串
        Context context1 = new Context(str1);
        Context context2 = new Context(str2);

        //程序节点，传入不同的上下文进行解释操作
        AbstractNode pNode1 = new ProgramNode();
        pNode1.interpreter(context1);

        System.out.println("");
        AbstractNode pNode2 = new ProgramNode();
        pNode2.interpreter(context2);
    }

}
